package tp.pr5.mv.command;

import tp.pr5.mv.CPU;
import tp.pr5.mv.Memory;
import tp.pr5.mv.OperandStack;
import tp.pr5.mv.ProgramCounter;
import tp.pr5.mv.traps.MVTrap;

public class STEP extends Command {
	

public boolean executeCommand(Memory mem, OperandStack stack, ProgramCounter pc,  CPU cpu) {
		

		try {		
		    cpu.step();		    
			return true;
		}
		catch ( MVTrap ex ) {		
			return false;
		}
		
	
}

public Command parse(String line) {
		
		if ( line.equalsIgnoreCase( "step" ) ) return new STEP(); // Parseamos si el comando introducido es step
		else return null;
	}

	
		
}
	
	
	
	
	
